import Cookies from 'js-cookie'

// App
const sidebarStatusKey = 'sidebar_status'
export const getSidebarStatus = () => Cookies.get(sidebarStatusKey)
export const setSidebarStatus = (sidebarStatus: string) => Cookies.set(sidebarStatusKey, sidebarStatus)

const languageKey = 'language'
export const getLanguage = () => Cookies.get(languageKey)
export const setLanguage = (language: string) => Cookies.set(languageKey, language)

const sizeKey = 'size'
export const getSize = () => Cookies.get(sizeKey)
export const setSize = (size: string) => Cookies.set(sizeKey, size)

// User
const tokenKey = 'vue_typescript_admin_access_token'
export const getToken = () => Cookies.get(tokenKey)
export const setToken = (token: string) => Cookies.set(tokenKey, token)
export const removeToken = () => Cookies.remove(tokenKey)

const userNameKey = 'user_name'
export const getUserName = () => Cookies.get(userNameKey)
export const setUserName = (username: string) => Cookies.set(userNameKey, username)

const userEmailKey = 'email'
export const getEmail = () => Cookies.get(userEmailKey)
export const setEmail = (email: string) => Cookies.set(userEmailKey, email)

const userRolesKey = 'user_roles'
export const getUserRoles = () => Cookies.get(userRolesKey)
export const setUserRoles = (roles: string) => Cookies.set(userRolesKey, roles)
